package com.hthy.futures.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.support.v4.app.FragmentTransaction;

import com.hthy.futures.R;
import com.hthy.futures.base.BaseActivity;
import com.hthy.futures.ui.fragment.BillSearchFragment;
import com.hthy.futures.ui.fragment.EntryExitFragment;
import com.hthy.futures.ui.fragment.MoneyStreamFragment;
import com.hthy.futures.ui.fragment.NoticeContentFragment;
import com.hthy.futures.ui.fragment.NoticeFragment;
import com.hthy.futures.view.TitleView;

import butterknife.Bind;

public class SearchCotainerActivity extends BaseActivity {
    @Bind(R.id.titleview)
    TitleView mTitleview;


    @Override
    protected int getContentView() {
        return R.layout.activity_slide_cotainer;
    }

    public static void gotoActivity(Context context, int code) {
        context.startActivity(new Intent(context, SearchCotainerActivity.class).putExtra("search", code));
    }

    @Override
    protected void initWidget() {
        super.initWidget();
        mTitleview.setBackBtn();
        int material = getIntent().getIntExtra("search", 0);
        FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
        switch (material)
        {
            case 0:
                mTitleview.setTitle("单据查询");
                BillSearchFragment billSearchFragment = new BillSearchFragment();
                fragmentTransaction.add(R.id.fl_container, billSearchFragment);
                break;
            case 1:
                mTitleview.setTitle("资金流水查询");
                MoneyStreamFragment moneyStreamFragment = new MoneyStreamFragment();
                fragmentTransaction.add(R.id.fl_container, moneyStreamFragment);
                break;
            case 2:
                mTitleview.setTitle("出入金查询");
                EntryExitFragment entryExitFragment = new EntryExitFragment();
                fragmentTransaction.add(R.id.fl_container, entryExitFragment);
                break;
            case 3:
                mTitleview.setTitle("公告");
                NoticeFragment noticeFragment = new NoticeFragment();
                fragmentTransaction.add(R.id.fl_container, noticeFragment);
                break;
        }
        fragmentTransaction.commit();
    }

}
